﻿using HDLogCenterService.Jobs;
using Quartz;

namespace HDLogCenterService.JobHandler
{
    public class LogConsumerJobRegister : IJobRegister
    {
        public string JobName => "LogCustomerJob";

        public void Register(IServiceCollectionQuartzConfigurator quartz)
        {
            quartz.AddJob<LogConsumerJob>(opts => opts.WithIdentity(JobName));
            quartz.AddTrigger(opts => opts
            .WithIdentity("LogCustomerTrigger")
            .ForJob(JobName)
            .WithSimpleSchedule(x => x.WithIntervalInSeconds(60).RepeatForever()));
        }
    }
}
